#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 55;

int n,w[N],A,B,bb[N],f[N][N][N][N],g[N][N],tot;

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; A = in,B = in;
	for(int i = 1;i <= n;i++) w[i] = bb[i] = in; memset(f,0x3f,sizeof(f)); memset(g,0x3f,sizeof(g));
	sort(bb+1,bb+n+1); tot = unique(bb+1,bb+n+1) - bb - 1; for(int i = 1;i <= n;i++) w[i] = lower_bound(bb+1,bb+tot+1,w[i]) - bb,f[i][i][w[i]][w[i]] = 0,g[i][i] = A;
	for(int len = 2;len <= n;len++)
		for(int l = 1,r = len;r <= n;l++,r++){
			for(int a = 1;a <= tot;a++)
				for(int b = a;b <= tot;b++){
					f[l][r][min(a,w[r])][max(b,w[r])] = min(f[l][r][min(a,w[r])][max(b,w[r])],f[l][r-1][a][b]);
					for(int k = l;k < r;k++)
						f[l][r][a][b] = min(f[l][r][a][b],f[l][k][a][b] + g[k+1][r]);
				}
			for(int a = 1;a <= tot;a++)
				for(int b = a;b <= tot;b++)
					g[l][r] = min(g[l][r],f[l][r][a][b] + (bb[b] - bb[a]) * (bb[b] - bb[a]) * B + A);
		}
	printf("%d\n",g[1][n]);
	return 0;
}

